package com.nd.controller.admin;

import com.nd.pojo.bo.*;
import com.nd.pojo.vo.*;
import com.nd.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @Author : PengFei Zhang
 * @Data :2021/6/4  20:40
 * @Description :
 */
//  用户管理  zpf
@RestController
@RequestMapping("admin")
public class UserController {
    @Autowired
    UserService userService;

    //会员管理
    @RequestMapping("user/list")
    public BaseRespVo list(UserManagementBo userManagementBo) {
        UserDataVo userData = userService.selectUserData(userManagementBo);
        return BaseRespVo.ok(userData);
    }

    //收货地址
    @RequestMapping("address/list")
    public BaseRespVo addressList(RecipientsAdressBo recipientsAdressBo) {
        RecipentsAdressVo recipentsAdressVo = userService.selectRecipientsAdress(recipientsAdressBo);
        return BaseRespVo.ok(recipentsAdressVo);
    }

    //会员收藏
    @RequestMapping("collect/list")
    public BaseRespVo collectList(UserCollectBo userCollectBo) {
        UserCollectVo userCollectVo = userService.selectUserCollectBo(userCollectBo);
        return BaseRespVo.ok(userCollectVo);
    }
    //会员足迹
    @RequestMapping("footprint/list")
    public  BaseRespVo footprintList(UserFootprintBo userFootprintBo){
        UserFootprintVo userFootprintVo=userService.selectUserFootprint(userFootprintBo);
        return BaseRespVo.ok(userFootprintVo);
    }
    //搜索历史
    @RequestMapping("history/list")
    public  BaseRespVo historyList(HistoryListBo historyListBo){
        UserHistoryListVo userHistoryListVo=userService.selectUserHistoryList(historyListBo);
        return BaseRespVo.ok(userHistoryListVo);
    }
    //意见反馈
    @RequestMapping("feedback/list")
    public  BaseRespVo FeedbackList(FeedbackListBo feedbackListBo){
        FeedbackListVo feedbackListVo= userService.selectFeedbackList(feedbackListBo);
        return BaseRespVo.ok(feedbackListVo);
    }
}
